using Assets.Scripts.GDK;

namespace Brick
{
	public class LockLock : gdk_base_UI
	{
		private bool isOpen = true;

		private bool isZheng = true;

		private bool canChange;

		private bool isJiaJian;

		public void SetJiaJian(bool bJia)
		{
			isJiaJian = true;
		}

		public void SetCanChange(bool bChange)
		{
			canChange = bChange;
		}

		public void SetOpen(bool bOpen)
		{
			if (canChange)
			{
				isOpen = bOpen;
				if (isJiaJian)
				{
					isZheng = bOpen;
				}
			}
		}

		public bool GetOpen()
		{
			return isOpen;
		}

		public bool GetZheng()
		{
			return isZheng;
		}

		public void OnChangeState()
		{
			if (canChange)
			{
				isOpen = !isOpen;
				if (isJiaJian)
				{
					isZheng = !isZheng;
				}
			}
		}
	}
}

